Java.perform(function() {
    console.log("Frida 脚本已注入");
    let BaseSsInterceptor = Java.use("com.bytedance.frameworks.baselib.network.http.retrofit.BaseSsInterceptor");
    BaseSsInterceptor["LIZ"].implementation = function (request) {
    let ret = this.LIZ(request);
    try {
       const url = request.getUrl();
    if(url.indexOf("aweme/v1/search/videosug") == -1){
        return ret;
    }
    console.log('LIZ is called' + ', ' + 'request: ' + request);
    //console.log("[+]--- url: "+ url);
    console.log("[+]--- Method: "+ request.getMethod());
    var fields = request.getClass().getDeclaredFields();
    if(fields.length == 0){
        console.log("无字段");
    }
    console.log("=====开始打印字段====");
    fields.forEach(function(field){
        field.setAccessible(true);
        var fieldName = field.getName();
        var fieldType = field.getType().getName();
        var fieldValue = field.get(request);
        console.log(`[+]---  ${fieldName}  [ ${fieldType} ] : ${fieldValue}`);
    })
    var body = request.getBody();
    var metrics = request.getMetrics();
    var Gson = Java.use("com.google.gson.Gson");
    var gson = Gson.$new();
    console.log("\n\nbody:"+ gson.LJIILL(body));
    console.log("\n\nmetrics:"+ gson.LJIILL(metrics));
    } catch (e) {
        console.log("解析请求体字段失败："+ e);
    }
    
    console.log('LIZ ret value is ' + ret);
    return ret;
    };
   
});